<?php
namespace Admin\Model;

use Think\Model\RelationModel;

class WxuserModel extends RelationModel
{
    protected $connection = array(
        'db_type'       =>  'mysql',
        'db_host'       =>  '114.55.30.131',
        'db_port'       =>  '3306',
        'db_name'       =>  'wxsmart',
        'db_user'       =>  'zhkj_crm',
        'db_pwd'        =>  'AdkdCGP7fHcjht5c',
        'db_charset'    =>  'utf8',
        'db_debug'      =>  true,
    );
    protected $tablePrefix = '';
    protected $tableName = 'tp_qtwy_customer';

    protected $_auto = array(
    );

    protected $_link = array(
        'WxuserInfo' => array(
            'mapping_type' => self::HAS_ONE,
            'class_name' => 'WxuserInfo',
            'mapping_name' => 'info',
            'foreign_key' => 'customer_id'
        ),
    );

    public function _before_write(&$data)
    {
        parent::_before_write($data); // TODO: Change the autogenerated stub
    }

    public function _after_insert($data, $options)
    {
        parent::_after_insert($data, $options); // TODO: Change the autogenerated stub
    }
}
